package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.RemoteSysDictData;
import com.ruoyi.system.api.factory.RemoteLogFallbackFactory;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 字典服务
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteDictService {
    /**
     * 根据类型查询字典值
     *
     * @param dictType 字典类型
     * @return 结果
     */
    @PostMapping("/dict/data/service/{dictType}")
    R<List<RemoteSysDictData>> getDictDatas(@PathVariable(value = "dictType") String dictType);


    @PostMapping("/dict/data/service/insertDictData")
    R insertDictData(@RequestParam("dictType") String dictType, @RequestParam("dictData") String dictData);

}
